<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录</title>

<script type="text/javascript">
function login(){
	var th = document.form1;
	if(th.email.value==""){
		alert("Email Can't Be Bull");
		th.email.focus();
		return;
	}
	if(th.password.value==""){
		alert("Password Can't Be Null");
		th.password.focus();
		return;
	}
	th.action="<%=path%>/LoginServlet";
		th.submit();
	}
</script>
<script type="text/javascript">
	function change() {
		var img = document.getElementById("verify");
		img.src = "VerifyCodeServlet?a=" + new Date().getTime();
	}
</script>

</head>
<body>
	<div align="center">
		<form name="form1" action="" method="post">
			<table>
				<tr>
					<td>邮箱:</td>
					<td><input name="email"></td>
				</tr>
				<tr>
					<td>密码:</td>
					<td><input name="password" type="password"></td>
				</tr>
				<tr>
					<td>验证码：</td>
					<td><input type="text" name="verifycode"></td>
					<td><a href="javascript:change()"><img src="VerifyCodeServlet" id="verify" border="0"></a></td>
				</tr>
				<tr>
					<td><input type="button" value="登录" onclick="login()"></td>
					<td><input type="button" value="注册" onclick="javascript:location.href='register.jsp'">
				</tr>
				<tr>${msg}</tr>

			</table>
		</form>
	</div>
</body>
</html>